﻿@model IEnumerable<blogDemo.Models.user>

@{
    ViewBag.Title = "Index";
}

<h2>用户管理</h2>

<table class="table table-bordered table-striped">
    <tr class="text-center">
        <th>
            用户名
        </th>
        <th>
            密码
        </th>
        <th>
            等级
        </th>
        <th>
            操作
        </th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.username)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.password)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.level)
            </td>
            <td>
                <button class="btn btn-sm">@Html.ActionLink("修改", "userEdit", new { id = item.ID })</button>
                <button class="btn btn-sm">@Html.ActionLink("删除", "userDelete", new { id = item.ID })</button>
            </td>
        </tr>
    }

</table>
<p>
    @Html.ActionLink("创建新用户", "userCreate")
</p>
